﻿using System;
using System.Collections.Generic;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer.stmt.mysql
{
	// Token: 0x0200015C RID: 348
	public class TMySQLSet : TCustomMySQLStmt
	{
		// Token: 0x06000BCC RID: 3020 RVA: 0x003069C5 File Offset: 0x00304BC5
		public TMySQLSet(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstmysqlset;
		}

		// Token: 0x06000BCD RID: 3021 RVA: 0x003069D9 File Offset: 0x00304BD9
		internal override void buildsql()
		{
		}

		// Token: 0x06000BCE RID: 3022 RVA: 0x003069DB File Offset: 0x00304BDB
		internal override void clear()
		{
		}

		// Token: 0x06000BCF RID: 3023 RVA: 0x003069DD File Offset: 0x00304BDD
		internal override string getasprettytext()
		{
			return "";
		}

		// Token: 0x06000BD0 RID: 3024 RVA: 0x003069E4 File Offset: 0x00304BE4
		internal override void iterate(TVisitorAbs pvisitor)
		{
		}

		// Token: 0x17000228 RID: 552
		// (get) Token: 0x06000BD1 RID: 3025 RVA: 0x003069E6 File Offset: 0x00304BE6
		// (set) Token: 0x06000BD2 RID: 3026 RVA: 0x003069EE File Offset: 0x00304BEE
		public virtual ESetStatementType SetStatementType
		{
			get
			{
				return this.setStatementType;
			}
			set
			{
				this.setStatementType = value;
			}
		}

		// Token: 0x17000229 RID: 553
		// (get) Token: 0x06000BD3 RID: 3027 RVA: 0x003069F7 File Offset: 0x00304BF7
		// (set) Token: 0x06000BD4 RID: 3028 RVA: 0x003069FF File Offset: 0x00304BFF
		public virtual TObjectName CharacterSetName
		{
			get
			{
				return this.characterSetName;
			}
			set
			{
				this.characterSetName = value;
			}
		}

		// Token: 0x1700022A RID: 554
		// (get) Token: 0x06000BD5 RID: 3029 RVA: 0x00306A08 File Offset: 0x00304C08
		// (set) Token: 0x06000BD6 RID: 3030 RVA: 0x00306A10 File Offset: 0x00304C10
		public virtual TObjectName CollationName
		{
			get
			{
				return this.collationName;
			}
			set
			{
				this.collationName = value;
			}
		}

		// Token: 0x1700022B RID: 555
		// (get) Token: 0x06000BD7 RID: 3031 RVA: 0x00306A19 File Offset: 0x00304C19
		// (set) Token: 0x06000BD8 RID: 3032 RVA: 0x00306A21 File Offset: 0x00304C21
		public virtual ETransactionIsolationLevel IsolationLevel
		{
			get
			{
				return this.isolationLevel;
			}
			set
			{
				this.isolationLevel = value;
			}
		}

		// Token: 0x1700022C RID: 556
		// (get) Token: 0x06000BD9 RID: 3033 RVA: 0x00306A2A File Offset: 0x00304C2A
		// (set) Token: 0x06000BDA RID: 3034 RVA: 0x00306A32 File Offset: 0x00304C32
		public virtual TObjectName Password
		{
			get
			{
				return this.password;
			}
			set
			{
				this.password = value;
			}
		}

		// Token: 0x1700022D RID: 557
		// (get) Token: 0x06000BDB RID: 3035 RVA: 0x00306A3B File Offset: 0x00304C3B
		// (set) Token: 0x06000BDC RID: 3036 RVA: 0x00306A43 File Offset: 0x00304C43
		public virtual TObjectName UserName
		{
			get
			{
				return this.userName;
			}
			set
			{
				this.userName = value;
			}
		}

		// Token: 0x1700022E RID: 558
		// (get) Token: 0x06000BDD RID: 3037 RVA: 0x00306A4C File Offset: 0x00304C4C
		// (set) Token: 0x06000BDE RID: 3038 RVA: 0x00306A54 File Offset: 0x00304C54
		public virtual List<TSetAssignment> Assignments
		{
			get
			{
				return this.assignments;
			}
			set
			{
				this.assignments = value;
			}
		}

		// Token: 0x06000BDF RID: 3039 RVA: 0x00306A60 File Offset: 0x00304C60
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			base.doParseStatement(psql);
			TSetSqlNode tsetSqlNode = (TSetSqlNode)this.rootNode;
			this.setStatementType = tsetSqlNode.SetStatementType;
			this.assignments = tsetSqlNode.Assignments;
			if (this.setStatementType == ESetStatementType.variable)
			{
				for (int i = 0; i < this.assignments.Count; i++)
				{
					TExpression expression = this.assignments[i].Expression;
					if (expression.ExpressionType == EExpressionType.simple_comparison_t)
					{
						expression.ExpressionType = EExpressionType.assignment_t;
						expression.doParse(this, ESqlClause.setVariable);
					}
				}
			}
			this.characterSetName = tsetSqlNode.CharacterSetName;
			this.collationName = tsetSqlNode.CollationName;
			this.userName = tsetSqlNode.UserName;
			this.password = tsetSqlNode.Password;
			this.isolationLevel = tsetSqlNode.IsolationLevel;
			return 0;
		}

		// Token: 0x06000BE0 RID: 3040 RVA: 0x00306B2B File Offset: 0x00304D2B
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06000BE1 RID: 3041 RVA: 0x00306B3C File Offset: 0x00304D3C
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			if (this.assignments != null)
			{
				foreach (TSetAssignment tsetAssignment in this.assignments)
				{
					tsetAssignment.acceptChildren(v);
				}
			}
			v.postVisit(this);
		}

		// Token: 0x040012C3 RID: 4803
		private List<TSetAssignment> assignments;

		// Token: 0x040012C4 RID: 4804
		private ESetStatementType setStatementType;

		// Token: 0x040012C5 RID: 4805
		private TObjectName characterSetName;

		// Token: 0x040012C6 RID: 4806
		private TObjectName collationName;

		// Token: 0x040012C7 RID: 4807
		private TObjectName userName;

		// Token: 0x040012C8 RID: 4808
		private TObjectName password;

		// Token: 0x040012C9 RID: 4809
		private ETransactionIsolationLevel isolationLevel;
	}
}
